<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('attraction_spot_remark', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('主键ID');
            $table->unsignedBigInteger('spot_id')->comment('点位ID');
            $table->unsignedBigInteger('user_id')->comment('用户ID');
            $table->text('remark')->comment('评价');
            $table->unsignedInteger('score')->comment('评分');
            $table->index(['spot_id'], 'spot_id_index');
            $table->datetimes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('attraction_spot_remark');
    }
};
